/**
 * @Description: 餐厅模块
 */
import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';

@Entity()
export class RestaurantEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ length: 50, comment: '餐厅名称' })
  name: string;

  @Column({ length: 255, comment: '餐厅地址' })
  address: string;

  /**
   * precision 表示该列的精度，即数字总共的位数；
   * scale 表示该列的小数位数；
   */
  @Column({
    type: 'decimal',
    precision: 10,
    scale: 6,
    comment: '餐厅经度',
    default: 0,
  })
  longitude: number;

  @Column({
    type: 'decimal',
    precision: 10,
    scale: 6,
    comment: '餐厅纬度',
    default: 0,
  })
  latitude: number;

  @Column({ comment: '餐厅图片', nullable: true })
  image: string;

  @Column({ comment: '餐厅公告', nullable: true })
  notice: string;

  @Column({ comment: '联系电话', nullable: true })
  phone: string;

  @Column({ comment: '起送价', default: 0 })
  minPrice: number;

  @Column({ comment: '配送费', default: 0 })
  deliveryFee: number;
}
